{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Objective : Working on TimeSeries Data\n",
    "<hr>\n",
    "\n",
    "1. Overview\n",
    "2. Timestamps vs. Time Spans\n",
    "3. Converting to timestamps\n",
    "4. Generating ranges of timestamps\n",
    "5. Timestamp limitations\n",
    "6. Indexing\n",
    "7. Time/date components\n",
    "8. DateOffset objects\n",
    "9. Time Series-Related Instance Methods\n",
    "10. Resampling\n",
    "11. Time span representation\n",
    "12. Converting between representations\n",
    "13. Representing out-of-bounds spans\n",
    "14. Time zone handling\n",
    "\n",
    "<hr>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1. Overview\n",
    "* Pandas contains extensive capabilities and features for working with time series data for all domains.\n",
    "* Using the NumPy datetime64 and timedelta64 dtypes, pandas has consolidated a large number of features from other Python libraries like scikits.timeseries as well as created a tremendous amount of new functionality for manipulating time series data.\n",
    "* pandas captures 4 general time related concepts:\n",
    "\n",
    "  - Date times: A specific date and time with timezone support. Similar to datetime.datetime from the standard library.\n",
    "  - Time deltas: An absolute time duration. Similar to datetime.timedelta from the standard library.\n",
    "  - Time spans: A span of time defined by a point in time and its associated frequency.\n",
    "  - Date offsets: A relative time duration that respects calendar arithmetic. Similar to dateutil.relativedelta.relativedelta from the dateutil package."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "date = pd.to_datetime(\"4th of July, 2015\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2015-07-04 00:00:00')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Saturday'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date.strftime('%A')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-01    0\n",
       "2000-01-02    1\n",
       "2000-01-03    2\n",
       "Freq: D, dtype: int64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series(range(3), index=pd.date_range('2000', freq='D', periods=3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    2011-01\n",
       "1    2011-02\n",
       "2    2011-03\n",
       "dtype: period[M]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series(pd.period_range('1/1/2011', freq='M', periods=3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
